#include "ServerApp.h"


CServerApp::CServerApp(void)
{
}


CServerApp::~CServerApp(void)
{
}

int CServerApp::CheckIn( MSServer::ClientInfo clientInfomation )
{
    m_AllClientInfo[clientInfomation.clientName] = clientInfomation;
    return 0;
}

int CServerApp::UploadRealPlayRequest( std::string clientName, std::string deviceServerSN, 
    std::string cameraAddr, bool isStartPlay )
{
    bool isExist = false;
    for (UINT i=0; i<m_AllClientRequest.size(); i++)
    {
        if (m_AllClientRequest[i].clientName == clientName
            && m_AllClientRequest[i].deviceServerSN == deviceServerSN
            && m_AllClientRequest[i].cameraAddr == cameraAddr)
        {
            m_AllClientRequest[i].isStartPlay = isStartPlay;
            isExist = true;
            return 0;
        }
    }

    if(!isExist)
    {
        ClientRequest client;
        client.clientName = clientName;
        client.deviceServerSN = deviceServerSN;
        client.cameraAddr = cameraAddr;
        client.isStartPlay = isStartPlay;
        m_AllClientRequest.push_back(client);
    }

    return 0;
}

int CServerApp::UploadMediaFrame( MSServer::MediaFrameInfo frameInfo )
{


    return 0;
}

int CServerApp::GetRequestListOfCamera( const std::string& deviceServerSN, 
    const std::string& cameraAddr, std::vector<MSServer::ClientInfo> &clientList )
{

    return 0;
}
